package com.dianpingmedia.simulate.model;

import afu.org.checkerframework.checker.igj.qual.I;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.*;
import java.util.List;

public class SimulatePlanEntity {

    public static class Request {
        @NotBlank(message = "id not blank")
        private String id;
        private String name;
        private String advertiser;
        @NotBlank(message = "advertiserId not blank")
        private String advertiserId;


        @Pattern(regexp = "((((19|20)\\d{2})-(0?(1|[3-9])|1[012])-(0?[1-9]|[12]\\d|30))|(((19|20)\\d{2})-(0?[13578]|1[02])-31)|(((19|20)\\d{2})-0?2-(0?[1-9]|1\\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$", message = "endDate is not match yyyy-mm-dd")
        private String beginDate;

        @Pattern(regexp = "((((19|20)\\d{2})-(0?(1|[3-9])|1[012])-(0?[1-9]|[12]\\d|30))|(((19|20)\\d{2})-(0?[13578]|1[02])-31)|(((19|20)\\d{2})-0?2-(0?[1-9]|1\\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$", message = "endDate is not match yyyy-mm-dd")
        private String endDate;

        @NotNull(message = "id not blank")
        @Min(value = 100)
        @Max(value = 999)
        private Integer dspId;

        @NotEmpty(message = "materialIds is empty")
        private List<String> materialIds;
        private List<String> certificateIds;
        @NotEmpty(message = "positionIds is empty")
        private List<String> positionIds;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAdvertiser() {
            return advertiser;
        }

        public void setAdvertiser(String advertiser) {
            this.advertiser = advertiser;
        }

        public String getAdvertiserId() {
            return advertiserId;
        }

        public void setAdvertiserId(String advertiserId) {
            this.advertiserId = advertiserId;
        }

        public String getBeginDate() {
            return beginDate;
        }

        public void setBeginDate(String beginDate) {
            this.beginDate = beginDate;
        }

        public String getEndDate() {
            return endDate;
        }

        public void setEndDate(String endDate) {
            this.endDate = endDate;
        }

        public Integer getDspId() {
            return dspId;
        }

        public void setDspId(Integer dspId) {
            this.dspId = dspId;
        }

        public List<String> getMaterialIds() {
            return materialIds;
        }

        public void setMaterialIds(List<String> materialIds) {
            this.materialIds = materialIds;
        }

        public List<String> getCertificateIds() {
            return certificateIds;
        }

        public void setCertificateIds(List<String> certificateIds) {
            this.certificateIds = certificateIds;
        }

        public List<String> getPositionIds() {
            return positionIds;
        }

        public void setPositionIds(List<String> positionIds) {
            this.positionIds = positionIds;
        }
    }


    public static class Response {
        private Integer code;
        private String message;
        private Integer errorCode;

        public Integer getErrorCode() {
            return errorCode;
        }

        public void setErrorCode(Integer errorCode) {
            this.errorCode = errorCode;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

    }


}
